﻿@model HotelRegistrationSystem.Models.RoomReservationModel

@using (Html.BeginForm("ReservationConfirmation", "Hotel", FormMethod.Post, new { id = "reservationForm" }))
{
    @Html.HiddenFor(x => Model.GuestsCount)
    @Html.HiddenFor(x => Model.HotelName)
    @Html.HiddenFor(x => Model.HotelId)
    
    <div class="detailsReservationDiv" id ="errorMessage">
        <p class="italicText">
        </p>
    </div>
    <br/><br/>
    <div class="detailsReservationDiv">
        <div class="dateBox">
            <p class="dateLabel">Start Date:</p>
            @Html.TextBoxFor(model => model.StartDate, new Dictionary<string, object>() { { "class", "datepickerstart" }, { "style", "float:left; width:110px; height:23px;" } })
        </div>
        <div class="dateBox">
            <p class="dateLabel">End Date:</p>
            @Html.TextBoxFor(model => model.EndDate, new Dictionary<string, object>() { { "class", "datepickerend" }, { "style", "float:left; width:110px; height:23px;" } })
        </div>
    </div>
    <br/><br/>
    <div class="detailsReservationDiv">
        <ul class="accordion">
            @foreach (HotelRegistrationSystem.Models.RoomTypeModel roomType in (ViewBag.RoomTypes as HashSet<HotelRegistrationSystem.Models.RoomTypeModel>))
            {
                <li id="@roomType.RoomTypeId">
                    <div class="title">
                        <h5>@roomType.Type</h5>
                    </div>
                    <div class="content" id="roomsPartialView_@roomType.RoomTypeId">
                        @{ Html.RenderPartial("_DetailsReservationRooms", Model,
                               new ViewDataDictionary { 
                                    { "SelectedDate", ViewBag.SelectedDate }, 
                                    { "RoomTypes", ViewBag.RoomTypes },
                                    { "StartDate", ViewBag.StartDate },
                                    { "EndDate", ViewBag.EndDate }, 
                                    { "RoomTypeId", roomType.RoomTypeId }
                                }
                        ); }
                    </div>
                </li>
            }
        </ul>
    </div>
    <div class="center_book_btn">
        <input id="submit_form" type="button" value="Reserve" class="button small radius" onclick ="checkReservation();"/>
    </div>
}